package com.cmic.rcs.emoji.web.controller;

import com.cmic.origin.DataEncryptUtil;
import com.cmic.rcs.emoji.util.AESUtils;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.codec.digest.DigestUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.configurationprocessor.json.JSONObject;

public class aaa {

    @Autowired
    private AESUtils aesUtils;

    public static void main(String[] args) throws JsonProcessingException {
        // 要解密的Base64字符串
        String encryptedText = "V9B92RPdXWtkqdNqxTzT0STu87hBugxsUQN/66mx7DiTbdQ5ikcV/p0fu+uZo/kTUmcBnsHTWEC7rUqj3zTvL9NnX6vfCQbocv3zjrga9YF3HA+Vtg6fMSn8A9rr623pf7SCoTJkuKoProplV/XC8hA2qqy16VDV9+0j6UF7YNDsOnTWXv0FCokgdzt3lUFWNRiSHqoCbMWS0b49ij3PFyOTTU3U00/b9GyIcua9NER3tTqn+XgxY0K+3h9fb28o62hCjxJbhsK7MqgeH6AQkcWrq5f3jHgvMXnRpqQFickca4g2tAWPHIuezTyZ1vk6KsbCmlo4yrrAMFd6F9WLbA==";

        // 使用类中定义的默认密钥和IV
        String key = "pXfIZ1nravvQpA7sSEthfLlr9xgnGzYs";
        String iv = "0000000000000000";

        try {
            String result = AESUtils.decrypt(encryptedText, key, iv);
            System.out.println("解密结果: " + result);
        } catch (Exception e) {
            System.err.println("解密异常: " + e.getMessage());
            e.printStackTrace();
        }
        try {
            String result = AESUtils.encrypt(encryptedText, key, iv);
            System.out.println("加密结果: " + result);
        } catch (Exception e) {
            System.err.println("加密结果异常: " + e.getMessage());
            e.printStackTrace();
        }
    }
}

@Data
@AllArgsConstructor
@NoArgsConstructor
class person {
    private String password;
}
